<template>
  <div id="app">
   {{addPx}}
   <input type="button" value="decrement" @click="decrement()">
   <input type="button" value="increment" @click="$store.dispatch('delayIncrement')">
   <div v-for="value,key in test" :key="key">
     {{key}}=====>>>>>>{{value}}
   </div>
    <router-view/>
  </div>
</template>

<script>
import { mapState, mapMutations, mapGetters,mapActions } from "vuex";
export default {
  name: "app",
  computed: {
    ...mapState({
      count: state => state.count,
      test: state => state.test
    }),
    ...mapGetters(["addPx"])
  },
  created() {
    // this.$http.json('https://api.douban.com/v2/book/1220562')
    this.getData();
  },
  methods: {
    ...mapMutations(["decrement", "increment"]),
    ...mapActions(['getData'])
  }
};

const obj = {
  a: 1,
  b: 2
};

const obj2 = {
  name: "123",
  age: 123,
  ...obj
};
console.log(obj2);
</script>

<style>

</style>
